package com.lin.redis.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @作者: 林江
 * @创建时间: 2024/3/9
 * @功能:
 */
@RestController
public class RedisController {
    @Autowired
    RedisTemplate redisTemplate;

    @RequestMapping("/pub")
    public String pub() {
        redisTemplate.convertAndSend("chatroom", "测试pub/sub");
        return "success";
    }
}
